babl-cache: incorporate BABL_PATH_LENGTH in header
authorØyvind Kolås <pippin@gimp.org>
Wed, 23 Nov 2016 10:36:28 +0000 (11:36 +0100)
committerØyvind Kolås <pippin@gimp.org>
Wed, 23 Nov 2016 10:36:28 +0000 (11:36 +0100)
babl/babl-cache.c
babl/babl-fish-path.c
babl/babl-internal.h

index e32e585e4b13c3c060206174ea32c96f3eeec25b..8d5ed618cf3de25b9895c535eb6f6a9a57948c07 100644 (file)
@@ -142,8 +142,8 @@ void babl_store_db (void)
   FILE *dbfile = fopen (fish_cache_path (), "w");
   if (!dbfile)
     return;
-  fprintf (dbfile, "#%s BABL_TOLERANCE=%f\n",
-           BABL_GIT_VERSION, _babl_legal_error ());
+  fprintf (dbfile, "#%s BABL_PATH_LENGTH=%d BABL_TOLERANCE=%f\n",
+           BABL_GIT_VERSION, _babl_max_path_len (), _babl_legal_error ());
 
   /* sort the list of fishes by usage, making next run more efficient -
    * and the data easier to approach as data for targeted optimization
@@ -256,8 +256,8 @@ void babl_init_db (void)
           /* if babl has changed in git .. drop whole cache */
           {
             char buf[2048];
-            sprintf (buf, "#%s BABL_TOLERANCE=%f",
-                     BABL_GIT_VERSION, _babl_legal_error ());
+            sprintf (buf, "#%s BABL_PATH_LENGTH=%d BABL_TOLERANCE=%f",
+               BABL_GIT_VERSION, _babl_max_path_len (), _babl_legal_error ());
             if (strcmp ( token, buf))
             {
               free (contents);
index cbe96184b524a9c7bea0e2578c47b1ac031bd632..f4df8cfbbe063d6b74b40f2ec6b6a50f26855823 100644 (file)
@@ -145,6 +145,11 @@ static int max_path_length (void)
   return max_length;
 }
 
+int _babl_max_path_len (void)
+{
+  return max_path_length ();
+}
+
 /* The task of BablFishPath construction is to compute
  * the shortest path in a graph where formats are the vertices
  * and conversions are the edges. However, there is an additional
index 992a7704d904dfbcd4db0bcb412e27ab1856b392..228faa5ab4cd1b889e2ba6136683b7a195f7c320 100644 (file)
@@ -319,5 +319,6 @@ static inline double babl_parse_double (const char *str)
 double _babl_legal_error (void);
 void babl_init_db (void);
 void babl_store_db (void);
+int _babl_max_path_len (void);
 
 #endif